<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动画</title>
    <style>
        /* .box1{
            width: 256px;
            height: 256px;
            margin: 0 auto;
            background-image: url(./img/bg2.png);
            animation: run1 0.2s steps(6) infinite;
        }

        /* 创建关键帧 
        @keyframes run1 {
            from{
                background-position: 0 0;
            }

            to{
                background-position: -1536px 0;
            }
        } */
        .box2{
            width: 100px;
            height: 100px;
            margin: 0 auto;
            background-image: url(./img/trump_run.png);
            animation: run2 1s steps(6) infinite;
        }

        @keyframes run2 {
            from{
                background-position: 0 0;
            }

            to{
                background-position: -600px 0;
            }
        }
    </style>
</head>
<body>
    <!-- <div class="box1"></div> -->
    <div class="box2"></div>
</body>
</html>